// 导入type
import { USER_INFO, USER_LOGOUT } from '@/store/actionTypes'
// 实例化reducer
function user(state = {}, action) {
  switch (action.type) {
    case USER_INFO:
      return action.payload
    // 用户信息部分 返回空对象即可
    case USER_LOGOUT:
      return {}
    default:
      return state
  }
}

// 暴露出去
export default user
